package com.alks.function.controller.finance.costcheck;


import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.dto.PcSlipDetailSoleReq;
import com.alks.function.mapper.finance.costcheck.PcSlipDetailSoleVo;
import com.alks.function.service.IPcSlipDetailSoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-05-24
 */
@ApiRestController("/pcSlipDetailSole")
@Api(tags = "底材收获检核")
public class PcSlipDetailSoleController {

    @Autowired
    IPcSlipDetailSoleService iService;

    @WebLogger
    @ApiOperation("大底入库单号查询")
    @PostMapping("/getSoleCheck")
    public ResponseInfo getSoleCheck(@RequestBody PcSlipDetailSoleReq req) {
        return iService.getSoleCheck(req);
    }

    //打勾记录检核
    @PostMapping("/optionSoleCheck")
    @WebLogger
    @ApiOperation("打勾记录检核")
    public ResponseInfo optionSoleCheck(@RequestBody List<String> slipNos, @RequestParam @ApiParam(value = "1:打勾记录检核 2:打勾取消检核") String check) {
        return iService.optionSoleCheck(slipNos,check);
    }

    //打勾备注确认
    @PostMapping("/setRemarkSole")
    @WebLogger
    @ApiOperation("打勾备注确认")
    public ResponseInfo setRemarkSole(@RequestBody List<String> slipNos,@RequestParam @ApiParam("备注") String remark){
        return iService.setRemarkSole(slipNos,remark);
    }
    //入库单明细查询

    @PostMapping("/setUnitPrice")
    @WebLogger
    @ApiOperation("取单价")
    public ResponseInfo setUnitPrice(@RequestBody List<PcSlipDetailSoleVo> list){
        return iService.setUnitPrice(list);
    }

    @PostMapping("/getSoleCheckDetail")
    @WebLogger
    @ApiOperation("入库单明细查询")
    public ResponseInfo getSoleCheckDetail(@RequestParam String slipNo) {
        return iService.getSoleCheckDetail(slipNo);
    }

    //入库单明细保存
    @PostMapping("/saveSoleCheck")
    @WebLogger
    @ApiOperation("入库单明细保存")
    public ResponseInfo saveSoleCheck(@RequestBody List<PcSlipDetailSoleVo> list) {
        return iService.saveSoleCheck(list);
    }

    //入库单刷新
    @GetMapping("/refreshSoleCheck")
    @WebLogger
    @ApiOperation("入库单刷新")
    public ResponseInfo refreshSoleCheck() {
        return iService.refreshSoleCheck();
    }

    //入库单删除
    @GetMapping("/deleteSoleCheck")
    @WebLogger
    @ApiOperation("入库单删除")
    public ResponseInfo deleteSoleCheck(@RequestParam List<String> slipNos) {
        return iService.deleteSoleCheck(slipNos);
    }

}
